﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;

namespace AnyOffice.general.system.addressForPj
{
    public partial class address_delete : ModulePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                int addressId = (Request.QueryString["address_id"] == null) ? 0 : int.Parse(Request.QueryString["address_id"].ToString());
                int num2 = (Request.QueryString["group_id"] == null) ? 0 : int.Parse(Request.QueryString["group_id"].ToString());
                new AddressPjDao().Delete(base.Conn, addressId, "");
                this.litMessage.Text = base.ShowPrompt("联系人删除成功！", "address.aspx?group_id=" + num2.ToString());
                StringBuilder builder = new StringBuilder("<script>\n");
                builder.Append("parent.menu.location.reload();\n");
                builder.Append("parent.main.location='address.aspx?group_id=" + num2.ToString() + "';\n");
                builder.Append("</script>\n");
                if (!this.Page.IsClientScriptBlockRegistered("address_list"))
                {
                    this.Page.RegisterClientScriptBlock("address_list", builder.ToString());
                }
            }
        }

    }
}
